package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

@Getter
@AllArgsConstructor
public enum ReserveTypeEnum {

    OUTSTANDING("1", "未决赔款准备金"),
    UNEARNED("2", "未到期保费准备金"),
    ;

    public static ReserveTypeEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String name;
}
